<header class="navigation fixed-top">
  <nav class="navbar navbar-expand-lg navbar-dark">
    <a class="navbar-brand" href="{{ .Site.BaseURL }}"><img src="{{ .Site.Params.logo | absURL }}" alt="{{.Site.Title}}"></a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navigation"
      aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse text-center" id="navigation">
      <ul class="navbar-nav ml-auto">
        <li class="nav-item active">
          <a class="nav-link" href="{{ .Site.BaseURL }}">{{ with .Site.Params.Home }} {{ . }} {{ end }}</a>
        </li>
        {{ range .Site.Menus.main }}
        {{ if .HasChildren }}
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true"
            aria-expanded="false">
            {{ .Name }}
          </a>
          <div class="dropdown-menu" >
            {{ range .Children }}
            <a class="dropdown-item" href="{{ .URL | absURL }}">{{ .Name }}</a>
            {{ end }}
          </div>
        </li>
        {{ else }}
        <li class="nav-item">
          <a class="nav-link" href="{{ .URL | absURL }}">{{ .Name }}</a>
        </li>
        {{ end }}
        {{ end }}
      </ul>
    </div>
  </nav>
</header>